#!/bin/sh

# [Gedit Tool]
# Name=Logtalk: generate TEXT documentation
# Comment=Generate TEXT documentation for the current Logtalk source file
# Shortcut=
# Input=nothing
# Output=output-panel
# Applicability=titled
# Save-files=nothing
# Languages=Logtalk

cd "$GEDIT_CURRENT_DOCUMENT_DIR"
FILE=`basename "$GEDIT_CURRENT_DOCUMENT_NAME" .lgt`
yaplgt -g "logtalk_compile($FILE), halt."
cd xml_docs
lgt2txt
xdg-open *.txt
